<?php
include_once("mysql_connect.inc.php");
include_once("hash.php");

//=========================================================================================================================================
function showUserForm($submitname, $function)
{
   global $errmsg;

   $SignatureID = "";
   $FirstName = "";
   $LastName = "";
   $hostuserid = "";
 
   if ((isset($_POST["FirstName"])) && ($function == EDITFUNCTION))
 {
      $SignatureID = $_POST["SignatureID"];
      $FirstName = $_POST["FirstName"];
	  $LastName = $_POST["LastName"];
	  $hostuserid = $_POST["hostuserid"];

  }
  else 
  { 
        $xxx = getUserNameFromDB();
		$SignatureID = $xxx["SignatureID"];
		$FirstName = $xxx["FirstName"];
		$LastName = $xxx["LastName"];
		$hostuserid = $_POST["hostuserid"];
		#print $xxx;
  }
   $formshow  = '<FORM METHOD="POST" ACTION="';
   $formshow .= 'editemployee.php">';;
 
   
   $formshow .= '<font color=red>'.$errmsg.'<br><br><br></font>';
   $formshow .= '<TABLE BORDER="0"><TR>';
  
    $formshow .= '<TD width="250">Host User ID';
  $formshow .= '</TD>';
  $formshow .= '<TD><INPUT TYPE="TEXT" ID="hostuserid" Name = "hostuserid" SIZE="40" value="'.$hostuserid.'" ';
  $formshow .= 'READONLY></TD></TR>';
  //------------------------------------------------------------------------
  $formshow .= '<TD width="250">First Name';
  if ($function == ADDFUNCTION || $function == EDITFUNCTION)
   {
      $formshow .= '<font color="red">*</font>';
   }
  $formshow .= '</TD>';
  $formshow .= '<TD><INPUT TYPE="TEXT" ID="FirstName" Name = "FirstName" SIZE="40" value="'.$FirstName.'" ';
  $formshow .= '</TD></TR>';
//------------------------------------------------------------------------
  $formshow .= '<TR><TD width="250">Last Name';
   if ($function == ADDFUNCTION || $function == EDITFUNCTION)
   {
      $formshow .= '<font color="red">*</font>';
   }
   $formshow .= '</TD>';
   $formshow .= '<TD><INPUT TYPE="TEXT" NAME="LastName" SIZE="40" value="'.$LastName.'" ';
   $formshow .= '</TD></TR>';
 //------------------------------------------------------------------------ 
  $formshow .= '<TR><TD width="250">Employee ID';
   if ($function == ADDFUNCTION || $function == EDITFUNCTION)
   {
      $formshow .= '<font color="red">*</font>';
   }
   $formshow .= '</TD>';
   $formshow .= '<TD><INPUT TYPE="TEXT" NAME="SignatureID" SIZE="40" value="'.$SignatureID.'" ';
   $formshow .= '</TD></TR>';  
 //------------------------------------------------------------------------  

   $formshow .= '</TABLE></br>';
 $formshow .= '<font size=2; color=red> * The following fields are Required</font>';
   if (($errmsg != userSaved) && ($function != INQUIREFUNCTION))
   {
      $formshow .= '<P ALIGN=CENTER><BR><BR><INPUT TYPE="SUBMIT" VALUE="'.$submitname.'" NAME="submit"></P>';
   }
  
   $formshow .= '</FORM>';

   print $formshow;
}
//=========================================================================================================================================
function showEmpList($submitname, $function)
{
   global $errmsg;

   $formshow  = '<FORM METHOD="POST" ACTION="';
   
   if ($function == EDITFUNCTION)
   {
      $formshow  .= 'editemployee.php">';
   }

   $formshow .= '<font color=red>'.$errmsg.'<br><br><br></font>';
   $formshow .= '<TABLE BORDER="0"><TR>';
   $formshow .= '<TD width="250">Employee</font></TD>';
   $formshow .= '<TD><SELECT name="hostuserid">';
   $formshow .= EmpListFromDBToSelect();
   $formshow .= '</SELECT></TD></TR>';
   $formshow .= '</TABLE>';
   $formshow .= '<P ALIGN=CENTER><BR><BR><INPUT TYPE="SUBMIT" VALUE="'.$submitname.'" NAME="submit"></P>';
   $formshow .= '</FORM>';

   print $formshow;
}
=======================================================================================================================================

?>
